//
//  HMGoldSTBootomBar.m
//  HowToDo
//
//  Created by 胡坤 on 2017/1/6.
//  Copyright © 2017年 KY. All rights reserved.
//

#import "HMGoldSTBootomBar.h"
#import "HMGoldSentence.h"
@interface HMGoldSTBootomBar ()
@property (weak, nonatomic) IBOutlet UIButton *sourceBtn;
@property (weak, nonatomic) IBOutlet UIButton *likeBtn;

@end

@implementation HMGoldSTBootomBar

+(instancetype)loadNibView
{
    return [[[NSBundle mainBundle]loadNibNamed:@"HMGlodSTBottomBar" owner:nil options:0]lastObject];
}
-(void)awakeFromNib
{
    [super awakeFromNib];
    
    CGFloat height = self.sourceBtn.bounds.size.height;
    
     self.sourceBtn.layer.cornerRadius = height *0.1;
    
     self.sourceBtn.layer.masksToBounds = YES;
    
    self.sourceBtn.enabled = YES;
}

- (IBAction)lookForSourceFrom:(UIButton *)sender
{
    self.pushTosourceFromDetial();
}

- (IBAction)likeSentenceCurrentAction:(UIButton*)sender
{
    NSInteger unlikeCount = sender.titleLabel.text.integerValue;
        unlikeCount++;
    [sender setTitle:[NSString stringWithFormat:@"%zd",unlikeCount] forState:UIControlStateNormal];
}
- (IBAction)sharelikeSentenceAction:(UIButton *)sender
{
}

-(void)setStence:(HMGoldSentence *)stence
{
    _stence = stence;
    
    [self.likeBtn setTitle:stence.like_count forState:UIControlStateNormal];

}

@end
